﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Sunboxsoft.ASMS.Client.Domain.WebRef
{
    public partial class ESettlementBillServiceItem
    {
        public string ServiceItemName { get; set; }

        public int ServiceItemStatus { get; set; }

        /// <summary>
        /// 总金额
        /// </summary>
        public decimal ActualAmount
        {
            get
            {
                return Math.Round(this.Price * this.Hour * this.Discount, 2);
            }
        }

        /// <summary>
        /// 状态(文字)
        /// </summary>
        public string ServieItemStatusText
        {
            get
            {
                if (this.ServiceItemStatus == Constant.MaintenanceBillServiceItemStatus.Finished)
                {
                    return "已竣工";
                }
                else if(this.ServiceItemStatus == Constant.MaintenanceBillServiceItemStatus.Working)
                {
                    return "施工中";
                }
                return "未派工";
            }
        }

        public ESettlementBillServiceItem()
        {
        }

        public ESettlementBillServiceItem(Guid maintenanceBillServiceItemId, string serviceItemName, int serviceItemStatus)
        {
            MaintenanceBillServiceItemId = maintenanceBillServiceItemId;
            ServiceItemName = serviceItemName;
            ServiceItemStatus = serviceItemStatus;
        }
    }
}
